home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 6 / The Arsenal Files 6 (Arsenal Computer).ISO / windows / wb32_96a.zip / DDETEST.WB_ < prev    next >
Text File  |  1995-11-09  |  4KB  |  98 lines

  1. ;;Program manager WBT script.  Adding/Deleting/Showing Program Manager Groups and Icons.  
  2.  
  3.                     ;;Written February 1994  by Wilson WindowWare, Inc.  
  4.                     ;;Modifed July 1995
  5.  
  6. ;;Call Progman.wil
  7. ;;Syntax of commands:
  8. ;;    Call("progman.wil", "AddGroup 'Group Title'")
  9. ;;        (             , "DelGroup 'Group Title'")
  10. ;;        (             , "AddIcon 'Group Title' 'File and Path' 'Icon Description' 'wrk dir'")
  11. ;;        (             , "DelIcon 'Group Title' 'Icon Description'")
  12. ;;        (             , "ShowGroup 'Group Title' ShowCommand")
  13. ;;        (             , "ReplaceItem 'Group Title' 'Icon Description'")
  14. ;;        (             , "Reload 'Group Title'")
  15. ;;        (             , "IconDump 'Group Title''Icon Description' 'variable name'")
  16. ;;        (             , "ProgBuild 'Group Title''variable name'")
  17. ;;    Call("progman.wil", "AddNewData '%grptitle%', '%data%'")
  18.  
  19.  
  20. ;;Show command is an integer which specifies the action Program Manager is to perform on the group window.
  21. ;;        VALUE          ACTION
  22. ;;          1               Restores group to its original size and position.
  23. ;;          2               Displays group as an icon.
  24. ;;          3               Displays group as a maximized window.
  25. ;;          6               Minimizes the group window.
  26. ;;                                 
  27.  
  28.  
  29. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  31.  
  32. Display(5, "Progman.Wil Test Run", "Progman.wil will show the main group in various display modes.")
  33.  
  34.  
  35. Call("Progman.wil", "ShowGroup 'Accessories' 1 ")
  36. delay(2)
  37. Call("Progman.wil", "ShowGroup 'Accessories' 2 ")
  38. delay(2)
  39. Call("Progman.wil", "ShowGroup 'Accessories' 3 ")
  40. delay(2)
  41. Call("Progman.wil", "ShowGroup 'Accessories' 6 ")                         
  42. delay(2)
  43. Call("Progman.wil", "Reload ")
  44. delay(2)
  45. exit
  46.  
  47. Display(5, "Progman.Wil Test Run",  "Progman.wil will now add a group, an icon, and then replace the icon.")
  48.  
  49. Call("progman.wil", "ADDGroup 'Group One' ")
  50. delay(2)
  51. Call("Progman.wil", "AddIcon 'Group One' 'C:\windows\clock.exe' 'tick tock' ")
  52. delay(2)
  53. Call("Progman.wil", "ReplaceItem 'Group One' 'tick tock'")
  54. delay(2)
  55. Call("Progman.wil", "AddIcon 'Group One' 'C:\WINDOWS\NOTEPAD.EXE' 'Notepad' ")
  56. delay(2)
  57.  
  58. Message("IconDump Test Run", "By passing a groupname and icon, this command can return the icons syntax.") 
  59. Call("progman.wil", "Icondump 'Group One' 'Notepad' 'fred'")
  60. fred=StrReplace(fred,'"','')        ;;replace quotes with null-string.
  61. Display(4,"Dump of icon from group:%grptitle%", fred)
  62.  
  63. Call("progman.wil", "DelIcon 'Group One' 'Notepad'")
  64. delay(1)
  65. Call("progman.wil", "DelGroup 'Group One' ")
  66. delay(1)
  67.  
  68. Message("Progbuild Test Run", "This option displays a list box of groups. %@crlf% Select a group and its icon information will be displayed. %@crlf% Select an icon title and the syntax will be returned.")
  69. Call("progman.wil", "Progbuild 'joan'")
  70. Display(4,"Dump of Progbuild from group:%grptitle%", joan)
  71.  
  72. delay(2)
  73. ;Clipput(joan)    ;;Put the string into the clipboard using ClipPut.
  74.                   
  75. ;;;
  76. ;;;To break the syntax into pieces use the following code.
  77.  
  78. joan=StrReplace(joan,'"','')           ;;replace quotes with null-string.
  79. icondesc= ItemExtract( 1, joan, ",")    ;;extract each of the items.
  80. Cmdline = ItemExtract( 2, joan, ",")
  81. wrkdir  = ItemExtract( 3, joan, ",")
  82. icofile = ItemExtract( 4, joan, ",")
  83. xpos    = ItemExtract( 5, joan, ",")
  84. ypos    = ItemExtract( 6, joan, ",")
  85. index   = ItemExtract( 7, joan, ",")
  86. hotkey  = ItemExtract( 8, joan, ",")
  87. minimize= ItemExtract( 9, joan, ",")
  88.  
  89. dadata=StrCat('desc=',icondesc, @crlf, 'cmdline=',cmdline, @crlf, 'wrkdir =',wrkdir, @crlf, 'icofile=',icofile,@crlf, 'xpos=',xpos, @crlf,  'ypos=',ypos, @crlf,  'index=',index, @crlf, 'hotkey =',hotkey,@crlf,  'minimize=',minimize)   
  90. message("Icon Syntax Information", dadata)
  91.  
  92. ;;Put the parts back together in proper order.
  93. data=StrCat(cmdline,',',icondesc,',',icofile,',',index,',',xpos,',',ypos,',',wrkdir,',',hotkey,',',minimize)
  94. ;Call("progman.wil", "AddNewData '%grptitle%', '%data%'") 
  95.  
  96.  
  97. Message("DDETEST.WBT EXAMPLE", "That's all folks..")
  98.